package cn.actionListener;

import cn.action.TeachAction;
import cn.action.TreatmentAction;
import cn.entity.StartView;
import cn.entity.img.HpBar;
import cn.entity.master.Fighter;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;
import java.io.IOException;

public class TreatmentListener implements KeyListener {
    private TreatmentAction TreatmentAction ;
    private StartView startView;
    private HpBar hpBar;
    private Fighter fighter;
    public TreatmentListener(StartView startView, HpBar hpBar,Fighter fighter) {
        this.TreatmentAction = new TreatmentAction();
        this.startView = startView;
        this.hpBar = hpBar;
        this.fighter = fighter;
    }
    @Override
    public void keyTyped(KeyEvent e) {

    }

    @Override
    public void keyPressed(KeyEvent e) {
        int key = e.getKeyCode();
        TreatmentAction.Treatment(key, fighter,hpBar);

    }
    @Override
    public void keyReleased(KeyEvent e) {
        int key = e.getKeyCode();
        TreatmentAction.TreatmentStop(key);

    }
}
